jQuery(function($) {

    $(".rg-gallery").on("mousedown", ".rg-image", mousedown);
    $(".rg-gallery").on("mouseup", ".rg-image", mouseup);
//    $(".rg-gallery").mousedown(mousedown);
//    $(".rg-gallery").mouseup(mouseup);


});
var startX = 0, startY = 0;

function mousedown(e) {
    startX = e.clientX;
    startY = e.clientY;
}

function mouseup(e) {
    var endX = e.clientX;
    var endY = e.clientY;
    var differenceX = startX - endX;
    var differenceY = Math.abs(startY - endY);
//    alert(startX+"/"+endX);
//    if (differenceX >= 50 && differenceY <= 50) {
//        $(".rg-image-nav-prev").trigger("click");
//    } else if (differenceX <= -50 && differenceY <= 50) {
//        $(".rg-image-nav-next").trigger("click");
//    }


}

